########################################################################
#
#                 Langlet configuration
#
########################################################################


##################  automatically generated ############################

# Warning! do not touch this. This section is automatically generated by fs.py

LANGLET_OFFSET = 9728

#################  langlet generic defs  ##############################

from EasyExtend.global_conf import*

from lexdef.lex_token import LexerToken as lex_token
import lexdef.lex_nfa    as lex_nfa
import lexdef.lex_symbol as lex_symbol
import parsedef.parse_nfa as parse_nfa
import parsedef.parse_symbol as parse_symbol
import parsedef.parse_token as parse_token

symbol = parse_symbol
token  = parse_token

FSConfig.langlet_table.append( {"offset":LANGLET_OFFSET,
                                "symbol": symbol,
                                "token": token} )
def tokenize(source):
    from EasyExtend.eecommon import tokenize
    import langlet
    return tokenize(langlet, source)

def parse(source, start_symbol = None):
    import langlet
    return EasyExtend.eecommon.parse(langlet, source, start_symbol)

unparse = Unparser(symbol, token, offset = LANGLET_OFFSET)

sys.path.append((os.sep).join(symbol.__file__.split(os.sep)[:-3]))

#############   user defined  ##########################################

opt = eeoptions.getoptions()
opt.add_option("--xml-pyRXP", dest="xml_pyRXP", action = "store_true", help="use pyRXP XML parser")
opt.add_option("--xml2p4d", dest="xml2p4d", action = "store_true", help="translate xml file into p4d file")
opt.add_option("--flex", dest="flex", action = "store_true", help="option used together with --xml2p4d to indicate flex specific transformations")
opt.add_option("--p4d:kwd", dest="p4d_kwd", action = "store_true", help="prefixes a tag with p4d that is a P4D keyword. This is applied on writing a P4D object")

# additional options can be defined here

options = {}

# extension for compiled modules. Default is .pyc

compiled_ext = ".pyc"

# extension for source modules. Default is .py

source_ext = ".p4d"

# prompt. Default prompt is '>>>'

prompt = "p4d> "

# langlet name

langlet_name = "p4d"


########################################################################


